using 组合模式;

/// <summary>
/// 表示文件系统中的文件  (子叶节点Leaf)
/// </summary>
public class File : FileSystemComponent
{
  private long _size;

  public File(string name, long size)
  {
    Name = name;
    _size = size;
  }

  public override long GetSize() => _size;

  public override void Delete()
  {
    Console.WriteLine($"删除文件: {Name}");
  }
}